package Hxw3DEngine.core.materials {

	import Hxw3DEngine.core.materials.Material3D;
	import Hxw3DEngine.core.materials.shader.newFilter.ColorFilter;
	import Hxw3DEngine.core.materials.shader.Shader3D;
	import Hxw3DEngine.utils.Color;

	/**
	 * 纯色材质 
	 * @author Neil
	 * 
	 */	
	public class ColorMaterial extends Material3D {

		private var _color 	: Color;
				
		/**
		 *  
		 * @param color	颜色
		 * 
		 */		
		public function ColorMaterial(color : Color) {
			super();
			this.shader = new Shader3D([new ColorFilter(color)]);
			this.color   = color;
		}
		
		public function get color() : Color {
			return _color;
		}
		
		public function set color(value : Color) : void {
			_color 	= value;
			ColorFilter(shader.getFilterByClass(ColorFilter)).color = value;
		}
		
		
	}
}
